<!DOCTYPE html>
<html lang="en">
<head>
	<meta charset="UTF-8">
	<title>angular双向数据绑定</title>
	<script type="text/javascript" src="angular.min.js"></script>
</head>
<body ng-app="myApp">
	<p>绑定数据方法一</p>
	<input type="text" ng-model="name" ng-model="name2">
	<p>hello,{{name}}</p>
	<p>绑定数据方法二</p>
	<p>hello,<span ng-bind="name"></span></p>

	<p>初始值方法一ng-init</p>
	<p ng-init="name2='吴纯玲'">hello,{{name2}}</p>
	<p>我买了<input type="text" ng-model="price">斤白菜</p>
	<p>总共<span>{{price*3}}</span>元</p>

	<p>初始值方法二</p><p>用控制器controller实现初始化值</p>

	<div ng-controller="myCtrl">

	名: <input type="text" ng-model="firstName"><br>
	姓: <input type="text" ng-model="lastName"><br>
	<br>
	姓名: {{firstName + " " + lastName}}

	</div>

	<script>
	var app = angular.module('myApp', []);
	app.controller('myCtrl', function($scope) {
	    $scope.firstName= "John";
	    $scope.lastName= "Doe";
	});
	</script>

</body>
</html>